{include mobile_template('header')}
<link rel="stylesheet" href="{URLROOT}/{$_G[tplurl_mobile]}/css/party.css" />
<div class="panel-common panel-default panel-fullsize">
    <div class="panel-heading">
        <div class="fr">
            <a href="javascript:;" id="filter_btn"><span class="label-comm label-mycolor label-big">筛选</span></a>
        </div>
        <h4>$MOD[name]</h4>
    </div>
    <ul class="list-group list-group-insertmod party-list" id="data_container">
        {eval include mobile_template('party_list_li')}
    </ul>
    <div id="page_container" class="mb10"></div>
</div>
<div class="panel-common panel-default"  id="filter_box" style="display:none;">
    <div class="panel-body">
        <div class="form-box">
            <input type="hidden" name="pageurl" value="{print party_page_url($catid,$time,$flag,$order)}" data-url="{url party/mobile/do/list/p/_PARAMS_}">
            <ul class="side_categorylist">
                <h5>活动分类</h5>
                <li><a {if !$catid}class="selected"{/if}href="#" data-name="cat" data-value="0">全部</a></li>
                <!--{get:party vval=category(catid/0)}-->
                <li><a {if $catid==$vval[catid]}class="selected"{/if}href="#" data-name="cat" data-value="$vval[catid]">$vval[name]</a></li>
                <!--{/get}-->
            </ul>
            <div class="clear"></div>
            <ul class="side_categorylist">
                <h5>时间范围</h5>
                <!--{loop $time_arr $k $v}-->
                <li><a {if $time==$k}class="selected"{/if}href="#" data-name="time" data-value="$k">$v</a></li>
                <!--{/loop}-->
            </ul>
            <div class="clear"></div>
            <ul class="side_categorylist">
                <h5>活动状态</h5>
                <!--{loop $flag_arr $k $v}-->
                <li><a {if $flag==$k}class="selected"{/if}href="#" data-name="flag" data-value="$k">$v</a></li>
                <!--{/loop}-->
            </ul>
            <div class="clear"></div>
            <ul class="side_categorylist">
                <h5>排序方式</h5>
                <!--{loop $order_arr $k $v}-->
                <li><a {if $order==$k}class="selected"{/if}href="#" data-name="order" data-value="$k">$v</a></li>
                <!--{/loop}-->
            </ul>
            <div class="clear"></div>
            <div class="form-submit mt10">
                <div class="btn-group btn-group-auto">
                    <div class="btn-group">
                        <a class="btn btn-mycolor" id="submit_btn" href="javascript:" data-type="submit">提交</a>
                    </div>
                    <div class="btn-group">
                        <a class="btn btn-default" href="javascript:" data-type="close">取消</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
$(document).ready(function() {

    page = $('#page_container').m_ajaxpage({
        container:'#data_container'
    });

    new $.m_drawer('#filter_box', {}, {
        onInit:function(container, workArea) {
            workArea.find('ul.side_categorylist > li > a').each(function() {
                var a = $(this);
                $(this).click(function() {
                    var ajax_url = workArea.find('[name="pageurl"]').data('url').replace(/&amp;/ig, "&");
                    a.parent().parent().find('a').removeClass('selected');
                    a.addClass('selected');
                    var params = 'cat_time_flag_order';//_PARAMS_
                    workArea.find('ul.side_categorylist > li a.selected').each(function() {
                        params = params.replace($(this).data('name'), $(this).data('value'));
                    });
                    workArea.find('[name="pageurl"]').val(ajax_url.replace('_PARAMS_', params));
                    return false;
                });
            });
            workArea.find('[data-type="submit"]').click(function(){
                page.get(workArea.find('[name="pageurl"]').val(), true);
                container.close();
            });
            $('#filter_btn').click(function() {
                container.open();
            });
        }
    });

});
</script>
{include mobile_template('footer')}